<!DOCTYPE html> 
<?php
include("../Include/functions.inc.php");

$eventID = $_GET['id'];

$index = 0;

$events = getEventById($eventID);

//Déclaration variables pour les informations de l'évènement
$titreEvent;
$langueEvent;
$dureeEvent;
$descriptionEvent;
$dateDebutEvent;
$TYPEFR;
$TYPEDE;
$nomConferencier;
$prenomConferencier;
$THEMEFR;
$THEMEDE;
$nomSalle;


while ($row = mysql_fetch_array($events, MYSQL_NUM)) {
    $titreEvent = htmlentities(mysql_escape_string($row[1]));
    $langueEvent = htmlentities(mysql_escape_string($row[2]));
    $dureeEvent = $row[3];
    $descriptionEvent = htmlentities(mysql_escape_string($row[4]));
    $dateDebutEvent = $row[5];
    $TYPEFR = htmlentities(mysql_escape_string($row[7]));
    $TYPEDE = $row[8];
    $nomConferencier = htmlentities(mysql_escape_string($row[9]));
    $prenomConferencier = htmlentities(mysql_escape_string($row[10]));
    $THEMEFR = htmlentities(mysql_escape_string($row[11]));
    $THEMEDE = htmlentities(mysql_escape_string($row[12]));
    $nomSalle = htmlentities(mysql_escape_string($row[13]));
    $reservation=$row[14];
     $prix=$row[15];
    $index++;
}

//Découpage de la date
$jour = substr($dateDebutEvent, -11, 2);
$mois = substr($dateDebutEvent, -14, 2);
$annee = substr($dateDebutEvent, -19, 4);
?>
<html> 
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1"> 
        <title>Event infos dialog</title> 
        <!Librairie JQuery mobible>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" />
    <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script>


    <script src="http://code.jquery.com/mobile/latest/jquery.mobile.min.js"></script>

    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <?php
        session_start();
        include('../Include/translations.php');
    ?>
</head> 

<body> 

    <div data-role="page">

        <div data-role="header" data-theme="d">
            <h1><?php echo $titreEvent; ?></h1>

        </div>

        <div data-role="content" data-theme="c">
            <ul data-role="listview" data-theme="c">
                <li>
                    <table>

                        <tr>

                            <td width="50%"><p align="left" style="text-shadow: inherit; display:inline;  font-size: small">
                                    <b>     
                                        <?php
                                        echo $textes['duree'][$_COOKIE['lang']] .' : ' . $dureeEvent . ' min.';
                                        ?>

                                    </b>
                                </p></td>
                            <td width="50%">
                                <p align="center"  style="text-shadow:inherit; display:inline;  font-size: small">
                                    <b>
                                        <?php
                                        $heure = substr($dateDebutEvent, -8);

                                        echo $textes['heure'][$_COOKIE['lang']] .' : ' . $heure;
                                        ?>      
                                    </b>
                                </p>

                            </td>
                            <td width="50%">
                                <p align="right" style="text-shadow: inherit; display:inline;  font-size: small">
                                    <b>     
                                        <?php
                                        echo $textes['salle'][$_COOKIE['lang']] .' : ' . $nomSalle;
                                        ?>
                                    </b></p>

                            </td>
                        </tr>
                    </table>
                </li>

                <li><h3><?php echo $textes['description'][$_COOKIE['lang']] ?></h3><textarea disabled="true" class="ui-input-text"><?php echo $descriptionEvent ?></textarea></li>

                <li>
                    <h3><?php echo $prenomConferencier . ' ' . $nomConferencier; ?></h3>
                    <p><?php echo $textes['langue'][$_COOKIE['lang']] ?> : <?php echo $langueEvent; ?></p>
                    <p><?php echo $textes['type'][$_COOKIE['lang']] ?> : <?php echo $TYPEFR; ?></p>
                    <p><?php echo $textes['date'][$_COOKIE['lang']] ?> : <?php echo $jour . '/' . $mois . '/' . $annee; ?></p>
                    <p><?php echo $textes['prix'][$_COOKIE['lang']] ?> : <?php if($prix=="0")echo $textes['gratuit'][$_COOKIE['lang']]; else echo $prix; ?></p>
                    <?php if($reservation=="1")echo '<p>'.$textes['reservation_obligatoire'][$_COOKIE['lang']].'</p>';?>
                    
                </li>

                <a href="docs-dialogs.html" data-role="button" data-rel="back" data-theme="b">OK</a>    
            </ul>
        </div>

    </div>


</body>

</html>